<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" lang="en">
<h:head>
	<title><ui:insert name="title">PrimeFaces Ecuador</ui:insert></title>
	<h:outputScript name="js/global.js" library="assets" />
	<h:outputStylesheet name="css/global.css" library="assets" />
	<ui:include src="include/header.xhtml" />
	<script type="text/javascript">
		$(document).on('turbolinks:click', function() {
			NProgress.start();
		});
		$(document).on('turbolinks:render', function() {
			NProgress.done();
			NProgress.remove();
		});

		function isSelectedRecord(widgetVar) {
			var count = PF(widgetVar).selections.length;
			if (count == 0) {
				PF('alertDialog').show();
			}
			return count == 0 ? false : true;
		}

		function isDelSelectedRecord(jqid) {
			PrimeFaces.confirm({
				source : jqid,
				escape : true,
				header : "提示",
				message : "Are you sure?",
				icon : "fa fa-exclamation-circle",
				beforeShow : ""
			});
			return false;
		}
	</script>
	<ui:insert name="head" />
</h:head>
<h:body>
	<div class="layout-content" style="min-height: 300px">
		<p:growl id="globalMessageGrowl" widgetVar="globalMessageGrowl"
			showDetail="true" showSummary="true" sticky="false" life="3000"
			autoUpdate="false" redisplay="true" severity="info,error" />

		<h:form id="confirmDialogForm">
			<p:confirmDialog id="confirmDialog" widgetVar="confirmDialog"
				header="warning" responsive="true" closable="true" global="true"
				showEffect="fade" hideEffect="fade" width="300">
				<f:facet name="message">
					<h:outputText value="Are you sure delete it?" />
				</f:facet>

				<p:commandButton value="#{msg['framework']['yes']}" type="button"
					styleClass="ui-confirmdialog-yes" icon="fa fa-check" />
				<p:commandButton value="#{msg['framework']['no']}" type="button"
					styleClass="ui-confirmdialog-no" icon="fa fa-close" />
			</p:confirmDialog>
			<p:confirmDialog id="alertDialog" widgetVar="alertDialog"
				header="warning" severity="warn fa" responsive="true"
				closable="true" global="false" showEffect="fade" hideEffect="fade"
				width="300">
				<f:facet name="message">
					<h:outputText value="select one record" />
				</f:facet>
				<p:commandButton value="#{msg['framework']['sure']}" type="button"
					styleClass="ui-confirmdialog-no" icon="fa fa-check"
					onclick="PF('alertDialog').hide()" />
			</p:confirmDialog>
		</h:form>
		<ui:insert name="content" />
		<ui:insert name="dialog" />
		<p:ajaxStatus styleClass="layout-ajax-loader">
			<f:facet name="start">
				<i class="fa fa-circle-o-notch fa-spin layout-ajax-loader-icon"
					aria-hidden="true"></i>
			</f:facet>
			<f:facet name="complete">

			</f:facet>
		</p:ajaxStatus>
	</div>
	<h:outputStylesheet name="css/nanoscroller.css"
		library="ecuador-layout" />
	<h:outputStylesheet name="css/layout-#{guestPreferences.layout}.css"
		library="ecuador-layout" />
</h:body>
</html>